Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 1 - Introduction to QuickDraw GX / QuickDraw GX Objects


Kinds of QuickDraw GX Objects

There are about a dozen different kinds of QuickDraw GX objects that you can use, beginning with the most fundamental object, the shape. Figure 1-1 on page 1-8 shows some of those objects and how they relate to each other; this section describes them and others.

Shape Objects

A shape is something that you can draw. Besides drawing it, you can also measure, parse, move, rotate, distort, check for intersection and union, make bold, simplify, and otherwise manipulate it. The fundamental purpose of QuickDraw GX is to create, manipulate, and draw shapes.

A shape consists of a shape object and three other associated objects (style, ink, and transform). A shape object consists of a geometry of a certain shape type (such as a line, rectangle, bitmap, or text) and information about how the geometry is framed or filled when drawn. A shape also has attributes, such as whether it should be stored in accelerator-card memory, if present. It also has references to its other three related objects.

Shapes and shape objects in general are discussed in the chapter "Shape Objects" in this book. More specifically, however, shapes are divided into types. There are two basic categories of shape type: graphic and typographic.

Graphic Shapes

Graphic shapes include geometric shapes, bitmap shapes, and picture shapes:

Graphic shapes are described further in Inside Macintosh: QuickDraw GX Graphics.
That book also describes functions for performing geometric operations, such as measurement, simplification, and constructive geometry, on graphic and typographic shapes.

Typographic Shapes

Typographic shapes represent text items--individual glyphs, collections of glyphs, or lines of text. The geometry of a typographic shape contains the text characters or glyphs of the shape, plus other information. There are three kinds of typographic shapes:

Typographic shapes are described further in Inside Macintosh: QuickDraw GX Typography.

Supporting Objects

Several other QuickDraw GX objects exist in support of shape objects. They are
either directly or indirectly referenced by the shape object whose behavior they
affect. Figure 1-2 shows the three objects that are directly referenced by a shape object;
Figure 1-1 on page 1-8 includes these objects as well as additional objects referenced indirectly by the shape object.

Figure 1-2 A shape object and its referenced objects

Style Object

A style object describes certain characteristics affecting how a shape is drawn. For geometric shapes, this includes information such as the thickness of the pen, the joins between line segments, and any dash or pattern to apply to the shape. For typographic shapes, it includes information such as the font, text size, and typeface of the text. For layout shapes in particular, it includes information such as kerning behavior and font-feature selection.

Style objects in general are described in the chapter "Style Objects" in this book. Style objects used by graphic shapes are described in the geometric styles chapter of Inside Macintosh: QuickDraw GX Graphics; style objects used by typographic shapes are described in the typographic styles chapter of Inside Macintosh: QuickDraw GX Typography.

Ink Object

An ink object describes a shape's color and its transfer mode--how that color is applied when the shape is drawn. Inks support many different kinds of color specification, and many different transfer modes.

Ink objects are described in the chapter "Ink Objects" in this book.

Transform Object

A transform object describes the clip and mapping applied to a shape when it is drawn. The clip limits the extent of the shape; it can be described by any shape geometry, and QuickDraw GX provides constructive geometry functions with which you can easily manipulate clips by combining them with other shapes. The mapping is a 3 3 matrix that defines translation, scaling, skewing, rotation, or perspective. Transforms also describe information used for hit-testing a shape and its parts. Transforms have references to one or more view ports, objects that describe where the shapes are drawn.

Transform objects are described in the chapter "Transform Objects" in this book.

Color Set Object and Color Profile Object

A color set object is like a color table; it contains an indexed set of colors. Color sets are used when colors are specified by index instead of by direct color value. Bitmaps commonly use color sets.

A color profile object contains color matching information. The information in a color profile can be used to convert device-specific colors to device-independent colors, to provide the most faithful reproduction of colors on different devices. QuickDraw GX can automatically perform color matching with available color profiles whenever it draws.

Color sets and color profiles are described in the chapter "Color and Color-Related Objects" in this book.

View Port Object, View Device Object, and View Group Object

A view port object is the location into which an application draws a shape. A view port object has a clip and a mapping that define a window (or a part of a window, such as a window pane). View ports can be arranged in a hierarchy.

A view device object typically describes a physical display device such as a monitor or printer (or an area of memory for offscreen drawing). It has a mapping, a clip, and a bitmap that describe the view device's position, dimensions, pixel depth and colors, and color profile.

A view group object describes an imaging world, the global space in which view ports and view devices are located. Within a view group, view ports and view devices can overlap each other in any combination; the intersection of each view port with a view device determines what is actually drawn on that device.

View ports, view devices, and view groups are described in the chapter "View-Related Objects" in this book.

Tag Object

A tag object is a general container for information that an application wants to add to a QuickDraw GX object. Tag objects can have anything in them, from labels to alternate drawing instructions to anything else you feel is useful. You can attach a tag object to the tag list of most other kinds of objects (except other tag objects).

Tag objects are described in the chapter "Tag Objects" in this book.

Font Object

A font object is the QuickDraw GX representation of an installed font. A font object contains information about the font's names, encodings, font variations, and other tables. See the fonts chapter of Inside Macintosh: QuickDraw GX Typography for more information.

Graphics Client Object

A graphics client is the object representation of the QuickDraw GX memory allocated for an application, which is separate from the application's own memory. A graphics client has no accessible properties, and in most cases your application never explicitly creates one. See the memory management chapter of Inside Macintosh: QuickDraw GX Environment and Utilities for more information.

Printing Objects

One category of QuickDraw GX objects exists to support printing. The printing objects include those shown in Figure 1-3 plus several others. Figure 1-3 shows the three principal QuickDraw GX printing objects (job, format, and paper-type), plus the three collection objects they use.

Figure 1-3 Printing objects

Note
Printing objects are different in some aspects from other QuickDraw GX objects. Most importantly, they exist in application memory instead of QuickDraw GX memory; this affects their behavior in several ways, as noted in later sections of this chapter.

Job Object, Format Object, and Paper-Type Object

The job object is the primary holder of printing information for a document. Every printable document has a job object associated with it. The job object specifies information such as the number of copies and the page range for printing, and includes references to one or more format objects and two printer objects (one for formatting and one for current output).

The format object specifies information such as scaling and page dimensions for the document, and includes a reference to a paper-type object.

The paper-type object specifies information such as a paper-type name (such as "US Letter") and the physical dimensions of the paper.

See the core printing features chapter of Inside Macintosh: QuickDraw GX Printing for more information.

Collection Objects

The job object, format object, and paper type object also include references to collection objects, which are objects managed by the Collection Manager, a part of system software provided with QuickDraw GX. Collection objects can contain any type of data; for printing, they hold additional useful information, such as specifications for halftoning, that is not in the printing objects. The Collection Manager is described in the Collection Manager chapter of Inside Macintosh: QuickDraw GX Environment and Utilities.

Printer Object

The printer object is another printing object. It represents a physical printer and includes a name and type, a driver name and type, and a reference to one or more view device objects that describe the characteristics of the printer the application draws to when printing. See the advanced printing features chapter of Inside Macintosh: QuickDraw GX Printing for more information.

Print-File Object

A print-file object is a printing object that represents a print file, the file that is the printable representation of a document. When it prints a document, QuickDraw GX first creates a print file, and then uses that print file to create an image on a printer. See the advanced printing features chapter of Inside Macintosh: QuickDraw GX Printing for more information.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996